/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.itschapala.dsw2.EventosA.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author User
 */
@Entity
@Table(name = "information")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Information.findAll", query = "SELECT i FROM Information i"),
    @NamedQuery(name = "Information.findByIdtable1", query = "SELECT i FROM Information i WHERE i.idtable1 = :idtable1"),
    @NamedQuery(name = "Information.findByEvent", query = "SELECT i FROM Information i WHERE i.event = :event"),
    @NamedQuery(name = "Information.findByDate", query = "SELECT i FROM Information i WHERE i.date = :date"),
    @NamedQuery(name = "Information.findByTime", query = "SELECT i FROM Information i WHERE i.time = :time"),
    @NamedQuery(name = "Information.findByLocation", query = "SELECT i FROM Information i WHERE i.location = :location")})
public class Information implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idtable1")
    private Integer idtable1;
    @Size(max = 45)
    @Column(name = "Event")
    private String event;
    @Size(max = 45)
    @Column(name = "Date")
    private String date;
    @Size(max = 45)
    @Column(name = "Time")
    private String time;
    @Size(max = 45)
    @Column(name = "Location")
    private String location;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "information")
    private Register register;
    @JoinColumn(name = "idtable1", referencedColumnName = "idConfirmacion", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Confirmacion confirmacion;

    public Information() {
    }

    public Information(Integer idtable1) {
        this.idtable1 = idtable1;
    }

    public Integer getIdtable1() {
        return idtable1;
    }

    public void setIdtable1(Integer idtable1) {
        this.idtable1 = idtable1;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Register getRegister() {
        return register;
    }

    public void setRegister(Register register) {
        this.register = register;
    }

    public Confirmacion getConfirmacion() {
        return confirmacion;
    }

    public void setConfirmacion(Confirmacion confirmacion) {
        this.confirmacion = confirmacion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtable1 != null ? idtable1.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Information)) {
            return false;
        }
        Information other = (Information) object;
        if ((this.idtable1 == null && other.idtable1 != null) || (this.idtable1 != null && !this.idtable1.equals(other.idtable1))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mx.itschapala.dsw2.EventosA.modelo.Information[ idtable1=" + idtable1 + " ]";
    }
    
}
